package server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Server {
    public static void main(String[] args) throws IOException {
        ExecutorService es = Executors.newCachedThreadPool();
        ServerSocket server = new ServerSocket(9999);
        Socket client;
        while (true){
            client = server.accept();
            es.execute(new ServerThread(client));
        }
    }
}
